// JavaScript Document
$(function(){
	(function(){
		var container = $('#drama');
		var group = container.find('.j_group');
		var ext = container.find('.j_part');
		
		container.bind('click', function(e){
			var tar = e.target;
			if($(tar).closest('.j_group').length > 0){ //切换组
				container.find('.active').removeClass('active');
				var g = $(tar).closest('.j_group');
				var p = ext.get(g.attr('data-key'));
				$(g).addClass('active');
				$(p).addClass('active');	
			}else if($(tar).hasClass('j_each')){ //选择剧集
				$(tar).toggleClass('selected');	
				//维护已选择数组
			}
		});
	})();
});